<template>
  <a-layout class="zg-layout">
    <Sider :minLeftWidth="0" v-if="isDevelopment" />
    <a-layout style="padding: 24px; height: 100vh">
      <a-layout-content style="margin: 0">
        <a-config-provider :locale="zhCN" :prefixCls="prefixClsName">
          <router-view />
        </a-config-provider>
      </a-layout-content>
    </a-layout>
  </a-layout>
</template>

<script lang="ts" setup>
import zhCN from "ant-design-vue/es/locale/zh_CN";
import { computed, ref } from "vue";
/** 非预发环境不展示 */
const isDevelopment = computed(() => process.env.NODE_ENV === "development");

const prefixClsName = ref(process.env.VUE_APP_PREFIXCLS); // 子应用前缀，需配合less变量使用
// 子应用内部跳转时，通知侧边栏改变菜单状态
// const onRouteChange = () => {
//   if (window.eventCenterForAppNameVite) {
//     // 发送全局数据，通知侧边栏修改菜单展示
//     window.eventCenterForAppNameVite.setGlobalData({ name: "task" });
//   }
// };
</script>

<style>
.zg-layout {
  min-height: 100vh;
}
</style>
